<?php

namespace DesignNew\Flyweight;

/**
 * 以茶为例，首先定义茶的种类及茶具
 */
class TeaMaker
{
    protected $availableTea = [];

    public function make($preference)
    {
        if (empty($this->availableTea[$preference])) {
            $this->availableTea[$preference] = new KarakTea();
        }
        return $this->availableTea[$preference];
    }
}

